<template>
    <div class="container">
        <el-input-number v-if="propJson.isMaxNum && propJson.isMinNum" v-model="modelValue.variableValue" :min="propJson.minNum"
                         :max="propJson.maxNum" :disabled="propJson.isDisable"
                        :step="propJson.step" :step-strictly="propJson.stepStrictly"
                        :controls-position="propJson.controlsPosition" :size="propJson.size"/>

        <el-input-number v-if="!propJson.isMaxNum && propJson.isMinNum" v-model="modelValue.variableValue" :min="propJson.minNum"
                         :disabled="propJson.isDisable"
                         :step="propJson.step" :step-strictly="propJson.stepStrictly"
                         :controls-position="propJson.controlsPosition" :size="propJson.size"/>

        <el-input-number v-if="propJson.isMaxNum && !propJson.isMinNum" v-model="modelValue.variableValue"
                         :max="propJson.maxNum" :disabled="propJson.isDisable"
                         :step="propJson.step" :step-strictly="propJson.stepStrictly"
                         :controls-position="propJson.controlsPosition" :size="propJson.size"/>

        <el-input-number v-if="!propJson.isMaxNum && !propJson.isMinNum" v-model="modelValue.variableValue"
                         :disabled="propJson.isDisable"
                         :step="propJson.step" :step-strictly="propJson.stepStrictly"
                         :controls-position="propJson.controlsPosition" :size="propJson.size"/>
    </div>
</template>

<script>
import {getCommonParamObj} from "@/utils/commonParamUtil";

export default {
    name: "InputNumberComponent",
    props: ['propJson', 'commonParam'],
    computed: {
        modelValue() {
            let modelParamObj = getCommonParamObj(this.commonParam, this.propJson.bindVariable);
            if (!modelParamObj) {
                return {};
            } else {
                return modelParamObj;
            }
        }
    }
}
</script>

<style scoped lang="less">

</style>